﻿Public Class clCasillaCofre : Inherits clCasilla : Implements IEquatable(Of clCasillaCofre)

    Public Sub New(ByRef Objeto As Control) 'funciona
        MyBase.New(ElSuelo.Inaccesible, Objeto)
        ImagenPredeterminada = My.Resources.cofrecerrado
        If Objeto.GetType = GetType(PictureBox) Then
            TryCast(Objeto, PictureBox).BackgroundImage = ImagenPredeterminada
        End If
    End Sub
    
    Public Overloads Function Equals(ByVal CofreB As clCasillaCofre) As Boolean Implements System.IEquatable(Of clCasillaCofre).Equals
        Return clCasilla.Equals(Me, CofreB)
    End Function
    Public Overloads Shared Function Equals(ByVal A As clCasillaCofre, ByVal B As clCasillaCofre) As Boolean
        Return A.GetType = B.GetType.GetType And A.Control.Name = B.Control.Name
    End Function
End Class